const express = require('express')

const app = express();
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
// 解决跨域 cors
const cors = require('cors');
app.use(cors());
// 配置静态资源托管 图片
app.use('/static', express.static('./static'))

const home = require('./router/home')
app.use('/home', home)
const shop = require('./router/shop')
app.use('/shop', shop)
// http://127.0.0.1:3006/shop/getShopCarousel?id=666
app.listen(3006, () => {
    console.log('http://127.0.0.1:3006');
})

//  http://127.0.0.1:3006/static/home/banner1.png

// npm i nodemon -g
// nodemon index.js 
